XML
The XML of a piece defines it, but you can adjust the heaviness, friction, etc. in the Piece Editor. XML elements Compulsory. *name :Name of the piece, can also be changed when finishing the piece. *type :Type of the piece. Possible types are: player, world, enemy, treasure, key, lock *instructions :Only if player piece. Will be displayed on the instructions screen of the game. *golfScore : "yes" causes deaths to be added to a total instead of having lives. *score :The default score of the piece. Only works for treasures and enemies. *color :The default color of the piece. Only applies when you copy the piece and the color is not already used for another instance of the piece. *alpha :The default transparency settings for the piece. *startLives :The default amount of lives of the player piece. Compulsory. Defines how the piece interacts with other pieces and the screen. *decor :If true, it won't inteact with anything. Default value: "false" *destroyable :Whether the piece is destroyable or not. Default value: "false" *invisCollision :If set to "true", won't be triggered off for other pieces that hit the piece and the piece itself. Default value: "false" *climbable :Whether the piece is climbable or not. Climbable pieces tell other pieces that they are 'grounded' when they are over them. Default value: "false" The piece's shape. Adds a circle. x/y-coordinates determine the center of the circle. *x *y *radius Adds a box. x/y-coordinates determine the center of the box. *x *y *width *height Adds a polygon. x/y-coordinates should be added to the vertexes' coordinates, but they don't. Note: polygons mustn't be concave, meaning there must not be any angle over 180°. *x *y = = Defines a vertex of a polygon. The maximum amount of vertexes per polygon is 8. *x *y the piece's appearance. *type :The type of the graphics. Possible values: jpg, swf *priority :The layering of the piece. If it's 3 or below, the piece can move without the graphics moving. *url :The URL of the piece's graphics. *text :The default text for the piece. Only use for text pieces. *font :The text's font. Only use for text pieces. *sourcePixelsPerMeter :How many of the graphics' pixel fill one of PlayCrafter's meters. *bitmapRelCentroidX :X-offset for images in pixels. *bitmapRelCentroidY :Y-offset for images in pixels. *size :The Graphics' size. Default value: 1 *outline :If "on", a black line displays the shape defined in . Usage of this to get around not having Premium is discouraged. *friction :Default friction of the piece. Changeable in the Piece Editor. *bounciness :Default bounciness of the piece. Changeable in the Piece Editor. *anchored :Whether the piece is anchored or not (causes it to have a fixed position and rotation). Use "editable" to be able to set it in the Piece Editor. *density :Default density of the piece. Changeable in the Piece Editor. *solid :Whether the piece is solid or not. Use "editable" to be able to set it in the Piece Editor. *angularDeceleration :How much rotation is reduced over time. *deceleration :How much the speed is reduced over time. *angleLock :Whether the piece can rotate or not. *ignoreSetAng :If "true", you can't turn it in the Workshop. *gravity :Whether the piece is affected by gravity or not. Use "editable" to be able to set it in the Piece Editor. *collisionSoundURL :The URL of the collision sound. *collisionSoundPriority :The proirity of the collision sound. Use a high value to make sure it can be heard. *source :"perimeter": has the shape defined in ; "visual_as_rectangle": Use for text pieces. Auto-adjusts the perimeter to the text's size. Makes the piece able to only move in one direction. *angOffset :The angle offset of the prispatic joint. Measured clockwise. *length :The lenth of the prismatic joint. The piece can't move further if it reaches the end of it. Makes the piece rotate around a certain point. *x *y Contains the stimuli. Triggers when a key is pressed. *action :"OnDown": when the key is pressed; "WhileDown": While the key is pressed *key :Which key *extraKey :Alternative key Triggers regularly. *interval The interval, measured in seconds. Triggers when the piece is destroyed. Works also if the piece isn't destroyable. Triggers at a random period between shortInterval and longInterval. *shortInterval Minimum possible time in seconds. *longInterval Maximum possible time in seconds. Triggers on every frame, afterDelay things cause it to behave like a regularInterval stimulus. Triggers when the left mouse button is pressed. *action :"OnDown": when the key is pressed; "WhileDown": While the key is pressed Triggers when the piece is in sight of another piece. *maxDist :Maximum distancethe other piece can be for the stimulus to trigger off. *angleOffset :Angle offset. Measured clockwise. *type :The object sighted has to be of a certain type for the stimulus to trigger off. Triggers when the piece collides. *side :Which side the piece collides. Possible values: right, left, up, down (not verified) *typeFilter :Triggers only if the collided piece is of a certain type. *minForce :The minimum force the other piece ha to hit the piece for the stimulus to trigger off. *onlyLoose :Triggers only if the other piece isn't anchored. Awards the other piece's score. *scoreOnce *typeFilter Adds a life. *livesAwarded How many lives? Default is 1. Moves the piece. *groundHug :If "true", it will only work on the ground. *impulse :The force the piece is affected with. *speedLimit :The maximum speed the piece can achieve with this thrust. *onePerLife :If "true", the piece can only thruse once per life. Useful for golf balls. *forceAsAbsoluteVel :Doesn't thrust but set the velocity for the piece. *absoluteAng : If "true", it will go exactly in the same direction as if it were upright, no matter what. *offsetAng :The angle offset of the force. *rangeOfMaxImpulse Awards the piece's score. *scoreOnce Destroys the other piece. Shoots a projectile. *projectile :Use one of PlayCrafter's default projectiles or the ID of a piece. *xOffset *yOffset *angleOffset *vAngle :Rotational speed of the projectile. *impulse :The force the projectile is shot off with. *reloadTime :The minimum amount of time between two shots. *angleInaccuracy *rangeOfMaxImpulse *onePerLife :If "true", the piece can only shoot once per life. *angleAtTarget *inheritMomentum :Whether the projectile inmherits the momentum of the piece or not. *inheritGoalStatus :Whether the projetctile inherits the goal status of the piece or not. *rotateChild Tugs on any target selected by another XML tag. *speed How fast? The piece faces the direction it is moving in, and if not moving it defaults at East. Useful for projectiles. Teleports the other piece. Lets the piece appear on the other side of the screen if it'd else go out. Doesn't work with solid pieces. *hWrap :horizontal wrap *vWrap :Vertical wrap *force *offsetAng *maxDist Targets another piece. *targetType *needsLOS *mustBeDestroyable Rotates the piece. *torque *groundHug *absoluteForce *movePower *minDist Code of the 3 connect gem. Causes the piece to self-destruct if at least three same-colored versions of itself are touching. Warps the player to another level or just teleports him, depending on whether there's another piece of it's kind in the level or not. Destroys the piece. *forceDestroy :If "true", the piece will still be destroyed if it's undestroyable. Else, only will be triggered. Forces an amount of rotation into the piece. It will also rotate if it is anchored. *angle How much the piece is rotated. If set to zero, it will randomly rotate. Targets the other piece, if named by another XML tag. Checks how fast the piece is moving, and if the speed is outside the min and max, the speed will be adjusted. *min Minimum speed allowed. Set to 0 for no minimum. *max Maximum speed allowed. Set to 0 to completely stop motion. Plays the animation with the label declared in animLabel. Does only work when a correct swf is used as graphics. *animLabel Chooses which animation set in the swf to play. Obviously will not work if label does not exist in swf. Causes the piece to move back and forth in one direction. Best used with an always parent. All three tags here work with the "editable" setting. *range How far the piece moves. *pauseTime When the piece finishes, how long it waits before moving again. *moveSpeed How fast oscillation occurs. *offsetAng Direction. Forces the piece to move to the mouse. *groundHug *absoluteForce *movePower *minDist Emits particles. see Particle Effect for more details. PFX take a visualPriority of 3. *sourcePixelsPerMeter *lifetime *quantity *scale *color_r *color_g *color_b *velocity *inheritRotation *inheritMomentum *angleOffset *resistance *gravity *visualURL *alpha *vAngle *xOffset *yOffset *velocity *offsetAng The piece looks at the target specified by or . *secondaryDisplayLayerOnly *turnSpeed The piece explodes... Invisibly. You'll need to create your own appearance using animation or some other means. *typeFilter :If set, the explosion only affects pieces of a certain type. *blastRadius :The radius in which other pieces are blasted away. *killRadius :The radius in which other pieces are destroyed. *destroySelf :Whether the piece itself is destroyed by the explosion or not. *blastImpulse :The force the other pieces are blown away with. Conditions For all stimuli, you can add one or more of the following conditions, causing the stimuli to only act if these conditions are met: *mustBeGrounded The piece must be on the ground. Works like groundHug. *mustBeAirborne :The piece must be in mid-air. *notStopped : The piece must have motion. *notMoving : The piece must NOT have motion. *movingUp : The piece must be moving up. *movingDown : The piece must be moving down. *movingLeft : The piece must be moving left. *movingRight : The piece must be moving right. *facingUp : The piece must be looking up. *facingDown : The piece must be looking down. *facingLeft : The piece must be looking left. *facingRight : The piece must be looking right. *notRising : The piece must not be moving upwards. *notLateral :The piece must not move neither right nor left. *fireOnce :The stimulus only triggers once. *compassDirection :Intended for isometric pieces, but usable with other styles of pieces. Possible values are: N, NE, E, SE, S, SW, W, NW. *afterDelay :Triggers the actions a certain time after the stimulus was triggered. BlockAnim BlockAnim="true" can be used in every action to stop the animation. Actually only useful in <playAnim/> to stop all other animations. Certain ways to develop the swf will allow it to start being given new playAnim commands, but how it works will not be went over here, as this is not the appropriate topic. Category:Piece Creator